#!/usr/bin/env python
"""
Created on 26 janv. 2010

@author: paraita

Example: simple cos plot.
Show how to make and save a simple cosinus plot with labels, title and grid
"""

import numpy
import matplotlib.pylab as pylab
 
if __name__ == '__main__':
    print 'Affichage d\'une sinusoide'

    t = numpy.arange(0.0, 4.0, 0.01)
    s = numpy.cos(2 * numpy.pi * t)
    s2 = numpy.cos((2 * numpy.pi * t) - (numpy.pi / 4)) * 0.5
    pylab.plot(t ,s , "r:", t, s2, "b:")
    #pylab.plot(t,s2)
    
    pylab.xlabel('time (s)')
    pylab.ylabel('voltage (mV)')
    pylab.title('About as simple as it gets, folks')
    pylab.grid(True)
    pylab.savefig('simple_plot')

    pylab.show()